//
//  socket.h 
//  Socket
//
//  Created by Laurent Novac on 04.03.11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//
#if defined (WIN32) //if windows
    #include <winsock2.h>
    //this type is allready typedef on linux but not on windows
    typedef int socklen_t
#else
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <arpa/inet.h>
    #include <unistd.h>


    #define INVALID_SOCKET -1
    #define SOCKET_ERROR -1
    #define closesocket(s) close(s)//the function to close a socket is called closesocket on window, we do this typedef to be more confortable

    // useful typedef allready defined on windows
    typedef int SOCKET;
    typedef struct sockaddr_in SOCKADDR_IN;
    typedef struct sockaddr SOCKADDR;

#endif
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#define _PORT_ 3000

void socket_server();
void socket_client();
